#############################################################################
##
##  Warning: Later tests need more than the default memory allocation

#
gap> START_TEST("grpauto.tst");

# assertions test again and again that maps are homomorphisms. This gives
# no extra check but has cost
gap> SetAssertionLevel(0);

#
gap> G:=PcGroupCode(2664057732308087629446918084678644731357911420184737672,
> 6272);;
gap> H:=PcGroupCode(849169324138369034371257796152864931485540637536648,
> 6272);;
gap> IsomorphismGroups(G,H);
fail
gap> IsomorphismGroups(G,PcGroupCode(CodePcGroup(G),Size(G)))=fail;
false

#
# hard-iso
#
gap> G:=PcGroupCode(589146814442329838036024080610343654876506937853710969\
> 448924603190236492427673556989072961847,11664);;
gap> H:=PcGroupCode(801562094435225650939080918450186172844860829657513982\
> 80193370111859863168020375597783858966368416055,11664);;
gap> IsomorphismGroups(G,H);
fail
gap> IsomorphismGroups(G,PcGroupCode(CodePcGroup(G),Size(G)))=fail;
false

#
# hard-iso2
#
gap> G:=PcGroupCode(409374400436488159632156475187687419052272443300404477\
> 8304456449542618727,11664);;
gap> H:=PcGroupCode(409362703022669659121228158166302826716273465648729361\
> 3630709080224464487,11664);;
gap> K:=PcGroupCode(409374400436488159632788450059215346119864636722303267\
> 1585655861072658023,11664);;
gap> IsomorphismGroups(G,H);
fail
gap> IsomorphismGroups(G,K);
fail
gap> IsomorphismGroups(G,PcGroupCode(CodePcGroup(G),Size(G)))=fail;
false

#
# Many Spaces
#
gap> G:=PcGroupCode(338681823291028181778801710348121147721184790127576437,
> 29160);;
gap> H:=PcGroupCode(338681822494525443798297952136327929199594863010776437,
> 29160);;
gap> IsomorphismGroups(G,H);
fail
gap> IsomorphismGroups(G,PcGroupCode(CodePcGroup(G),Size(G)))=fail;
false

#
gap> G:=PcGroupCode(731609193963915469349479836674438288113664000126400,
> 15744);;
gap> H:=PcGroupCode(11518455149767885147152053318976713124993564672000126400,
> 15744);;
gap> IsomorphismGroups(G,H);
fail
gap> IsomorphismGroups(G,PcGroupCode(CodePcGroup(G),Size(G)))=fail;
false

#
gap> G:=PcGroupCode(18738408935379049727906755356708168311565445686261463850856,
> 21952);;
gap> H:=PcGroupCode(18738408935359210460657231881739776911013615108923450662760,
> 21952);;
gap> IsomorphismGroups(G,H);
fail

#
# Too hard work for permiso
#
gap> G:=Group((1,3,8,21,37,43,36,35)(2,6,15,30,41,29,19,4)(5,7,18,34,46,
> 32,38,25)(9,23,39,28,27,42,12,14)(10,26,17,20,24,33,13,11)(16,31,45,48,
> 44,47,40,22)(50,53)(51,52)(55,56)(57,58), (1,4,11,28,37,30,20,14)
> (2,3,9,24,41,43,27,10)(5,13,26,31,46,17,33,47)(6,16,32,15,29,44,7,19)
> (8,22,38,21,36,48,18,35)(12,23,40,25,39,42,45,34)(49,51)(50,52)(54,55)
> (56,57),(1,2,5,12,26)(3,7,17,6,14)(4,10,25,35,42)(8,20,9,18,15)
> (11,27,38,19,36)(13,29,28,43,32)(21,23,30,24,34)(33,37,41,46,39)
> (49,50,52,51,53));;
gap> Size(AutomorphismGroup(G));
2880000

#
# hard-iso4
#
gap> G:=PcGroupCode(
> 741231213963541373679312045151639276850536621925972119311,11664);;
gap> H:=PcGroupCode(
> 888658311993669104086576972570546890038187728096037768975,11664);;
gap> IsomorphismGroups(G,H);
fail
gap> IsomorphismGroups(G,PcGroupCode(CodePcGroup(G),Size(G)))=fail;
false

# Isomorphism tests
gap> gp1:=Group(
> (1,23,6,64,38)(2,42,18,19,11)(3,7,30,49,50)(4,14,20,45,46)(5,9,21,41,58,34,
> 17,29,48,44)(8,26,40,43,33)(10,22,59,60,32)(12,24,53,74,76)(13,31,55,81,77,
> 61,25,52,75,83)(15,27,51,78,79)(16,28,47,68,71,62,36,56,70,69)(35,57,82,92,
> 91,37,54,80,90,93)(66,72)(85,86)(88,94)(95,96)(97,98,100,102,104)(99,101,
> 103,105,106), (1,32,11,3)(2,10,23,7)(4,15,33,12)(5,13,34,61)(6,38,42,19)(8,
> 27,14,24)(9,25,17,31)(16,35,62,37)(18,63,64,39)(20,46,26,43)(21,44,29,
> 58)(22,60,30,50)(28,54,36,57)(40,67,45,65)(41,66,48,72)(47,69,56,71)(49,84,
> 59,73)(51,79,53,76)(52,77,55,83)(68,85,70,86)(74,89,78,87)(75,88,81,94)(80,
> 91,82,93)(90,95,92,96)(97,98)(99,101)(102,104)(105,106),
> (4,33)(8,14)(12,15)(16,62)(20,26)(24,27)(28,36)(35,37)(40,45)(43,46)(47,
> 56)(51,53)(54,57)(65,67)(68,70)(69,71)(74,78)(76,79)(80,82)(85,86)(87,
> 89)(90,92)(91,93)(95,96), (1,4)(2,8)(3,12)(5,16)(6,20)(7,24)(9,28)(10,
> 27)(11,33)(13,35)(14,23)(15,32)(17,36)(18,40)(19,43)(21,47)(22,51)(25,
> 54)(26,42)(29,56)(30,53)(31,57)(34,62)(37,61)(38,46)(39,65)(41,68)(44,
> 69)(45,64)(48,70)(49,74)(50,76)(52,80)(55,82)(58,71)(59,78)(60,79)(63,
> 67)(66,85)(72,86)(73,87)(75,90)(77,91)(81,92)(83,93)(84,89)(88,95)(94,96),
> (1,5)(2,9)(3,13)(4,16)(6,21)(7,25)(8,28)(10,31)(11,34)(12,35)(14,36)(15,
> 37)(17,23)(18,41)(19,44)(20,47)(22,52)(24,54)(26,56)(27,57)(29,42)(30,
> 55)(32,61)(33,62)(38,58)(39,66)(40,68)(43,69)(45,70)(46,71)(48,64)(49,
> 75)(50,77)(51,80)(53,82)(59,81)(60,83)(63,72)(65,85)(67,86)(73,88)(74,
> 90)(76,91)(78,92)(79,93)(84,94)(87,95)(89,96));;
gap> gp2:=Group(
> (4,16)(5,20)(8,14)(9,18)(12,15)(13,39)(23,29)(24,32)(27,30)(28,35)(42,47)(43,
> 50)(45,48)(46,60)(54,56)(55,58)(65,67)(66,72)(74,78)(75,81)(76,79)(77,
> 83)(87,89)(88,94), (1,2,6,21,40,11,26,44,64,22)(3,10,34,61,53,36,7,25,52,
> 62)(4,14,23,47,48)(5,9,24,43,60,20,18,32,50,46)(8,29,42,45,16)(12,27,56,74,
> 76)(13,35,58,81,77,39,28,55,75,83)(15,30,54,78,79)(17,33,49,69,71)(19,31,
> 51,68,70)(37,57,82,90,92)(38,59,80,91,93)(41,63)(66,72)(73,84)(88,94),
> (1,4,11,16)(2,8,26,14)(3,12,36,15)(5,19,20,17)(6,23,44,29)(7,27,10,30)(9,33,
> 18,31)(13,38,39,37)(21,42,64,47)(22,45,40,48)(24,51,32,49)(25,54,34,56)(28,
> 59,35,57)(41,65,63,67)(43,69,50,68)(46,71,60,70)(52,74,61,78)(53,76,62,
> 79)(55,82,58,80)(66,86,72,85)(73,87,84,89)(75,91,81,90)(77,93,83,92)(88,96,
> 94,95), (1,5)(2,9)(3,13)(4,17)(6,24)(7,28)(8,31)(10,35)(11,20)(12,37)(14,
> 33)(15,38)(16,19)(18,26)(21,43)(22,46)(23,49)(25,55)(27,57)(29,51)(30,
> 59)(32,44)(34,58)(36,39)(40,60)(41,66)(42,68)(45,70)(47,69)(48,71)(50,
> 64)(52,75)(53,77)(54,80)(56,82)(61,81)(62,83)(63,72)(65,85)(67,86)(73,
> 88)(74,90)(76,92)(78,91)(79,93)(84,94)(87,95)(89,96),
> (1,36,11,3)(2,10,26,7)(4,15,16,12)(5,39,20,13)(6,40,44,22)(8,30,14,27)(9,35,
> 18,28)(17,38,19,37)(21,63,64,41)(23,48,29,45)(24,60,32,46)(25,62,34,53)(31,
> 59,33,57)(42,67,47,65)(43,72,50,66)(49,71,51,70)(52,84,61,73)(54,79,56,
> 76)(55,83,58,77)(68,86,69,85)(74,89,78,87)(75,94,81,88)(80,93,82,92)(90,96,
> 91,95));;
gap> IsomorphismGroups(gp1,gp2)<>fail;
true
gap> gp1:=Group([(1,3,32,2,4,31)(5,6)(7,12,13,8,11,14)
> (9,19,23,10,20,24)(15,22,29,16,21,30)(17,27,26,18,28,
> 25)(33,37,44,36,43,42)(34,40,41,38,39,35)(45,61,66,53,
> 48,59)(46,57,50,58,64,60)(47,49,65,55,54,68)
> (51,67,62,52,56,63)(69,91,75,72,81,93)(70,76,79,80,87,
> 88)(71,77)(73,82,100,78,92,86)(74,99,89,84,96,94)
> (83,90,85,95,98,97),(1,12,32,7,28)(2,11,31,8,27)
> (3,6,13,26,17)(4,5,14,25,18)(9,24,15,20,22)
> (10,23,16,19,21)(33,39,37,38,35)(34,41,36,40,43)
> (45,50,65,49,64)(47,63,59,48,67)(53,60,68,54,57)
> (55,62,66,61,56)(69,87,85,91,90,72,76,97,81,98)
> (70,83,71,93,79,80,95,77,75,88)(73,94,86,82,99,78,89,
> 100,92,96)(74,84),(1,18,31,15)(2,17,32,16)
> (3,13,5,19)(4,14,6,20)(7,30,22,9)(8,29,21,10)
> (11,28,25,24)(12,27,26,23)(33,39)(34,42,38,44)(35,41)
> (36,40)(45,64)(46,68,58,65)(47,67)(48,49,61,54)
> (50,62,60,63)(51,59,52,66)(53,57)(55,56)(69,96,82,78)
> (70,76,75,94)(71,91,90,74)(72,99,92,73)(77,81,98,84)
> (79,97,100,83)(80,87,93,89)(85,86,95,88)]);;
gap> gp2:=Group([(1,6,3)(2,5,4)(7,23,25)(8,24,26)(9,19,31)
> (10,20,32)(11,15,18)(12,16,17)(13,27,22)(14,28,21)
> (33,42,38)(34,36,44)(35,37,39)(40,41,43)(45,48,50)
> (46,65,58)(47,54,63)(49,62,55)(51,67,66)(52,60,56)
> (53,57,61)(59,68,64)(69,83,81,72,74,95)(70,80,73,75,92,
> 79)(71,94,86,76,82,97)(77,87,78,84,88,89)(85,99,98,96,
> 93,91)(90,100),(1,13,2,14)(3,23,4,24)(5,18)(6,17)
> (7,8)(9,25,10,26)(11,20)(12,19)(15,16)(27,31,28,32)
> (34,38)(35,44)(37,40,43,39)(41,42)(45,50)(46,49)(47,63)
> (48,52)(51,57)(53,61)(54,59)(55,62)(56,64,66,58)
> (60,65,67,68)(69,74,72,83)(71,96,76,85)(77,94)(78,91)
> (80,95,92,81)(82,84)(86,97)(87,100,88,90)(89,98)(93,99),
> (1,30,23,26,16)(2,29,24,25,15)(3,14,9,6,18)
> (4,13,10,5,17)(7,22,12,28,19)(8,21,11,27,20)
> (33,38,41,43,44,36,34,35,37,42)(39,40)(46,56,68,49,63)
> (48,61,52,64,67)(50,51,58,60,57)(54,62,59,66,65)
> (69,75,90,86,96,72,70,100,97,85)(71,87,74,94,84,76,88,
> 83,82,77)(73,99,91,81,89,79,93,98,95,78)(80,92)]);;
gap> IsomorphismGroups(gp1,gp2)<>fail;
true

# Messy p-groups, forum by D.Robinson, 4/5/23
gap> g1:=Image(IsomorphismPcGroup(AutomorphismGroup(SmallGroup(64,112))));;
gap> g2:=SmallGroup(512,10493360);;
gap> IsomorphismGroups(g1,g2)<>fail;
true

# Two larger p groups
gap> gp1:=Group((1,2,5,11,21)(3,6,12,22,36)(4,7,13,23,37)
> (8,14,24,38,54)(9,15,25,39,55)(10,16,26,40,56)
> (17,27,41,57,73)(18,28,42,58,74)(19,29,43,59,75)
> (20,30,44,60,76)(31,45,61,77,91)(32,46,62,78,92)
> (33,47,63,79,93)(34,48,64,80,94)(35,49,65,81,95)
> (50,66,82,96,106)(51,67,83,97,107)(52,68,84,98,108)
> (53,69,85,99,109)(70,86,100,110,116)(71,87,101,111,117)
> (72,88,102,112,118)(89,103,113,119,122)(90,104,114,120,123)
> (105,115,121,124,125)(126,127,130,136,146)(128,131,137,147,161)
> (129,132,138,148,162)(133,139,149,163,179)(134,140,150,164,180)
> (135,141,151,165,181)(142,152,166,182,198)(143,153,167,183,199)
> (144,154,168,184,200)(145,155,169,185,201)(156,170,186,202,216)
> (157,171,187,203,217)(158,172,188,204,218)(159,173,189,205,219)
> (160,174,190,206,220)(175,191,207,221,231)(176,192,208,222,232)
> (177,193,209,223,233)(178,194,210,224,234)(195,211,225,235,241)
> (196,212,226,236,242)(197,213,227,237,243)(214,228,238,244,247)
> (215,229,239,245,248)(230,240,246,249,250),
> (1,3,8,17,31)(2,6,14,27,45)(4,9,18,32,50)
> (5,12,24,41,61)(7,15,28,46,66)(10,19,33,51,70)
> (11,22,38,57,77)(13,25,42,62,82)(16,29,47,67,86)
> (20,34,52,71,89)(21,36,54,73,91)(23,39,58,78,96)
> (26,43,63,83,100)(30,48,68,87,103)(35,53,72,90,105)
> (37,55,74,92,106)(40,59,79,97,110)(44,64,84,101,113)
> (49,69,88,104,115)(56,75,93,107,116)(60,80,98,111,119)
> (65,85,102,114,121)(76,94,108,117,122)(81,99,112,120,124)
> (95,109,118,123,125)(126,128,133,142,156)(127,131,139,152,170)
> (129,134,143,157,175)(130,137,149,166,186)(132,140,153,171,191)
> (135,144,158,176,195)(136,147,163,182,202)(138,150,167,187,207)
> (141,154,172,192,211)(145,159,177,196,214)(146,161,179,198,216)
> (148,164,183,203,221)(151,168,188,208,225)(155,173,193,212,228)
> (160,178,197,215,230)(162,180,199,217,231)(165,184,204,222,235)
> (169,189,209,226,238)(174,194,213,229,240)(181,200,218,232,241)
> (185,205,223,236,244)(190,210,227,239,246)(201,219,233,242,247)
> (206,224,237,245,249)(220,234,243,248,250),
> (1,3,8,17,31)(2,15,47,87,115)(4,9,18,32,50)
> (5,43,102,62,113)(6,28,67,103,49)(7,29,68,104,45)
> (10,19,33,51,70)(11,80,58,120,110)(12,63,114,82,44)
> (13,64,24,83,121)(14,46,86,30,69)(16,48,88,27,66)
> (20,34,52,71,89)(21,109,108,107,106)(22,98,78,124,40)
> (23,99,79,57,119)(25,84,41,100,65)(26,85,42,101,61)
> (35,53,72,90,105)(36,118,117,116,37)(38,111,96,81,59)
> (39,112,97,77,60)(54,123,122,56,55)(73,125,76,75,74)
> (91,95,94,93,92)(128,144,178,134,159)(131,154,194,140,173)
> (133,197,177,158,143)(137,168,210,150,189)(139,213,193,172,153)
> (142,157,176,196,215)(147,184,224,164,205)(149,227,209,188,167)
> (152,171,192,212,229)(156,214,175,230,195)(161,200,234,180,219)
> (163,237,223,204,183)(166,187,208,226,239)(170,228,191,240,211)
> (179,243,233,218,199)(182,203,222,236,245)(186,238,207,246,225)
> (198,217,232,242,248)(202,244,221,249,235)(216,247,231,250,241),
> (1,27,43,96,93)(2,41,59,106,33)(3,115,24,60,117)
> (4,46,64,110,108)(5,57,75,50,47)(6,121,38,76,71)
> (7,62,80,116,52)(8,30,101,22,125)(9,45,42,81,123)
> (10,67,85,119,118)(11,73,19,66,63)(12,124,54,20,87)
> (13,78,94,70,68)(14,44,111,36,105)(15,61,58,95,90)
> (16,83,99,122,72)(17,29,82,79,21)(18,49,114,39,91)
> (23,92,34,86,84)(25,77,74,35,104)(26,97,109,89,88)
> (28,65,120,55,31)(32,48,100,98,37)(40,107,53,103,102)
> (51,69,113,112,56)(127,132,141,155,174)(130,151,190,138,169)
> (131,140,154,173,194)(136,185,148,206,165)(137,168,210,150,189)
> (139,153,172,193,213)(146,220,201,181,162)(147,205,164,224,184)
> (149,188,227,167,209)(152,171,192,212,229)(161,234,219,200,180)
> (163,223,183,237,204)(166,208,239,187,226)(170,191,211,228,240)
> (179,243,233,218,199)(182,236,203,245,222)(186,225,246,207,238)
> (198,248,242,232,217)(202,244,221,249,235)(216,250,247,241,231));;
gap> gp2:=Group((3,19,53,9,34)(6,29,69,15,48)(8,72,52,33,18)
> (12,43,85,25,64)(14,88,68,47,28)(17,32,51,71,90)
> (22,59,99,39,80)(24,102,84,63,42)(27,46,67,87,104)
> (31,89,50,105,70)(36,75,109,55,94)(38,112,98,79,58)
> (41,62,83,101,114)(45,103,66,115,86)(54,118,108,93,74)
> (57,78,97,111,120)(61,113,82,121,100)(73,92,107,117,123)
> (77,119,96,124,110)(91,122,106,125,116)(127,174,155,141,132)
> (130,169,138,190,151)(131,194,173,154,140)(136,165,206,148,185)
> (137,189,150,210,168)(139,213,193,172,153)(146,162,181,201,220)
> (147,184,224,164,205)(149,209,167,227,188)(152,229,212,192,171)
> (161,180,200,219,234)(163,204,237,183,223)(166,226,187,239,208)
> (170,240,228,211,191)(179,199,218,233,243)(182,222,245,203,236)
> (186,238,207,246,225)(198,217,232,242,248)(202,235,249,221,244)
> (216,231,241,247,250),(2,49,30,16,7)(5,44,13,65,26)
> (6,69,48,29,15)(11,40,81,23,60)(12,64,25,85,43)
> (14,88,68,47,28)(21,37,56,76,95)(22,59,99,39,80)
> (24,84,42,102,63)(27,104,87,67,46)(36,55,75,94,109)
> (38,79,112,58,98)(41,101,62,114,83)(45,115,103,86,66)
> (54,74,93,108,118)(57,97,120,78,111)(61,113,82,121,100)
> (73,92,107,117,123)(77,110,124,96,119)(91,106,116,122,125)
> (128,134,144,159,178)(131,140,154,173,194)(133,158,197,143,177)
> (137,150,168,189,210)(139,172,213,153,193)(142,196,157,215,176)
> (147,164,184,205,224)(149,188,227,167,209)(152,212,171,229,192)
> (156,230,214,195,175)(161,180,200,219,234)(163,204,237,183,223)
> (166,226,187,239,208)(170,240,228,211,191)(179,218,243,199,233)
> (182,236,203,245,222)(186,246,238,225,207)(198,242,217,248,232)
> (202,249,244,235,221)(216,250,247,241,231),
> (1,22,68,123,113)(2,36,84,90,119)(3,98,104,122,5)
> (4,39,88,73,121)(6,108,114,89,11)(7,55,102,17,124)
> (8,78,45,56,43)(9,112,27,125,13)(10,59,14,92,61)
> (12,52,120,103,21)(15,118,41,105,23)(16,75,24,32,77)
> (18,97,66,76,64)(19,38,46,91,26)(20,80,28,107,82)
> (25,72,57,115,37)(29,54,62,31,40)(30,94,42,51,96)
> (33,111,86,95,85)(34,58,67,106,44)(35,99,47,117,100)
> (48,74,83,50,60)(49,109,63,71,110)(53,79,87,116,65)
> (69,93,101,70,81)(126,147,193,248,238)(127,180,149,176,235)
> (128,163,212,250,169)(129,164,213,198,246)(130,144,204,152,231)
> (131,199,166,195,165)(132,200,167,196,244)(133,182,228,220,189)
> (134,183,229,216,190)(135,184,139,217,186)(136,173,243,226,156)
> (137,158,222,170,162)(138,159,223,171,241)(140,218,187,214,185)
> (141,219,188,215,249)(142,202,155,234,209)(143,203,240,146,210)
> (145,205,153,232,207)(148,194,179,239,175)(150,177,236,191,181)
> (151,178,237,192,247)(154,233,208,230,206)(157,221,174,161,227)
> (160,224,172,242,225)(168,197,245,211,201),
> (1,36,112,83,115)(2,9,74,57,113)(3,54,120,100,49)
> (4,55,38,101,45)(5,29,52,117,110)(6,18,92,77,44)
> (7,19,93,78,121)(8,73,124,26,69)(10,75,58,114,66)
> (11,64,14,32,106)(12,47,71,122,40)(13,48,72,123,119)
> (15,33,107,96,65)(16,34,108,97,61)(17,91,81,43,88)
> (20,94,79,41,86)(21,99,63,104,31)(22,84,27,50,37)
> (23,85,28,51,116)(24,67,89,76,59)(25,68,90,125,60)
> (30,53,118,111,82)(35,109,98,62,103)(39,102,46,70,56)
> (42,87,105,95,80)(126,161,237,208,240)(127,128,243,222,246)
> (129,180,163,226,170)(130,131,197,232,249)(132,134,179,236,186)
> (133,242,202,138,140)(135,200,183,239,191)(136,137,213,176,250)
> (139,196,216,148,150)(141,144,199,245,207)(142,241,185,189,172)
> (143,248,221,151,154)(145,219,204,166,211)(146,147,227,192,230)
> (149,212,156,162,164)(152,195,201,205,188)(153,215,231,165,168)
> (155,159,218,182,225)(157,247,206,210,193)(158,198,235,169,173)
> (160,234,223,187,228)(167,229,175,181,184)(171,214,220,224,209)
> (174,178,233,203,238)(177,217,244,190,194));;
gap> IsomorphismGroups(gp1,gp2)=fail;
false
gap>STOP_TEST("grpauto.tst");
